roundedrect: Fix inlining of graphene functions
authorBenjamin Otte <otte@redhat.com>
Thu, 13 Feb 2020 06:33:18 +0000 (07:33 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 13 Feb 2020 06:36:38 +0000 (07:36 +0100)
graphene treats equality for contains() operations as always matching,
so do the same thing.

This is because unlike integer math, floating point cannot do the "as
close as possible to the point, but not reaching it" operation that
integer does by just subtracting 1.

gsk/gskroundedrect.c

index 2e01589639a2b612af0878f4d37d358b2e8b0591..4d95d52666d272b40055ee23089e704f1fbafa6a 100644 (file)
@@ -340,8 +340,8 @@ gsk_rounded_rect_locate_point (const GskRoundedRect   *self,
 {
   if (point->x < self->bounds.origin.x ||
       point->y < self->bounds.origin.y ||
-      point->x >= self->bounds.origin.x + self->bounds.size.width ||
-      point->y >= self->bounds.origin.y + self->bounds.size.height)
+      point->x > self->bounds.origin.x + self->bounds.size.width ||
+      point->y > self->bounds.origin.y + self->bounds.size.height)
     return OUTSIDE;
 
   if (self->bounds.origin.x + self->corner[GSK_CORNER_TOP_LEFT].width > point->x &&
@@ -417,8 +417,8 @@ gsk_rounded_rect_contains_rect (const GskRoundedRect  *self,
 {
   if (rect->origin.x < self->bounds.origin.x ||
       rect->origin.y < self->bounds.origin.y ||
-      rect->origin.x + rect->size.width >= self->bounds.origin.x + self->bounds.size.width ||
-      rect->origin.y + rect->size.height >= self->bounds.origin.y + self->bounds.size.height)
+      rect->origin.x + rect->size.width > self->bounds.origin.x + self->bounds.size.width ||
+      rect->origin.y + rect->size.height > self->bounds.origin.y + self->bounds.size.height)
     return FALSE;
 
   if (!gsk_rounded_rect_contains_point (self, &rect->origin) ||